﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;

namespace HotCopperUserScanService
{
    public class SendPostsEmail
    {
        public void SendEmail(string sender, string[] recipients, string subject, string body)
        {
            MailMessage message = new MailMessage();
            message.From = new MailAddress(sender);

            foreach (var recipient in recipients)
            {
                message.To.Add(new MailAddress(recipient));
            }

            message.Subject = subject;
            message.Body = body;

            SmtpClient client = new SmtpClient();
            client.Send(message);
        }
    }
}
